﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Messages.Category0;
using Little.Soldier.SWIFT.Messages.Category1;
using Little.Soldier.SWIFT.Messages.Category2;
using Little.Soldier.SWIFT.Messages.Category3;
using Little.Soldier.SWIFT.Messages.Category4;
using Little.Soldier.SWIFT.Messages.Category5;
using Little.Soldier.SWIFT.Messages.Category6;
using Little.Soldier.SWIFT.Messages.Category7;
using Little.Soldier.SWIFT.Messages.Category8;
using Little.Soldier.SWIFT.Messages.Category9;

namespace Little.Soldier
{
    internal class FinancialMessages
    {
        public static SwiftMessage GetSwiftMessage(SwiftMessage message)
        {
            switch (message.MessageType)
            {
                case "999":
                    return (SwiftMessage) new MT999(message);
                case "998":
                    return (SwiftMessage) new MT998(message);
                case "996":
                    return (SwiftMessage) new MT996(message);
                case "995":
                    return (SwiftMessage) new MT995(message);
                case "992":
                    return (SwiftMessage) new MT992(message);
                case "991":
                    return (SwiftMessage) new MT991(message);
                case "990":
                    return (SwiftMessage) new MT990(message);
                case "986":
                    return (SwiftMessage) new MT986(message);
                case "985":
                    return (SwiftMessage) new MT985(message);
                case "973":
                    return (SwiftMessage) new MT973(message);
                case "972":
                    return (SwiftMessage) new MT972(message);
                case "971":
                    return (SwiftMessage) new MT971(message);
                case "970":
                    return (SwiftMessage) new MT970(message);
                case "950":
                    return (SwiftMessage) new MT950(message);
                case "942":
                    return (SwiftMessage) new MT942(message);
                case "941":
                    return (SwiftMessage) new MT941(message);
                case "940":
                    return (SwiftMessage) new MT940(message);
                case "935":
                    return (SwiftMessage) new MT935(message);
                case "920":
                    return (SwiftMessage) new MT920(message);
                case "910":
                    return (SwiftMessage) new MT910(message);
                case "900":
                    return (SwiftMessage) new MT900(message);
                case "899":
                    return (SwiftMessage) new MT899(message);
                case "898":
                    return (SwiftMessage) new MT898(message);
                case "896":
                    return (SwiftMessage) new MT896(message);
                case "895":
                    return (SwiftMessage) new MT895(message);
                case "892":
                    return (SwiftMessage) new MT892(message);
                case "891":
                    return (SwiftMessage) new MT891(message);
                case "890":
                    return (SwiftMessage) new MT890(message);
                case "824":
                    return (SwiftMessage) new MT824(message);
                case "802":
                    return (SwiftMessage) new MT802(message);
                case "801":
                    return (SwiftMessage) new MT801(message);
                case "800":
                    return (SwiftMessage) new MT800(message);
                case "799":
                    return (SwiftMessage) new MT799(message);
                case "798":
                    return (SwiftMessage) new MT798(message);
                case "796":
                    return (SwiftMessage) new MT796(message);
                case "795":
                    return (SwiftMessage) new MT795(message);
                case "792":
                    return (SwiftMessage) new MT792(message);
                case "791":
                    return (SwiftMessage) new MT791(message);
                case "790":
                    return (SwiftMessage) new MT790(message);
                case "769":
                    return (SwiftMessage) new MT769(message);
                case "768":
                    return (SwiftMessage) new MT768(message);
                case "767":
                    return (SwiftMessage) new MT767(message);
                case "760":
                    return (SwiftMessage) new MT760(message);
                case "756":
                    return (SwiftMessage) new MT756(message);
                case "754":
                    return (SwiftMessage) new MT754(message);
                case "752":
                    return (SwiftMessage) new MT752(message);
                case "750":
                    return (SwiftMessage) new MT750(message);
                case "747":
                    return (SwiftMessage) new MT747(message);
                case "742":
                    return (SwiftMessage) new MT742(message);
                case "740":
                    return (SwiftMessage) new MT740(message);
                case "734":
                    return (SwiftMessage) new MT734(message);
                case "732":
                    return (SwiftMessage) new MT732(message);
                case "730":
                    return (SwiftMessage) new MT730(message);
                case "721":
                    return (SwiftMessage) new MT721(message);
                case "720":
                    return (SwiftMessage) new MT720(message);
                case "711":
                    return (SwiftMessage) new MT711(message);
                case "710":
                    return (SwiftMessage) new MT710(message);
                case "707":
                    return (SwiftMessage) new MT707(message);
                case "705":
                    return (SwiftMessage) new MT705(message);
                case "701":
                    return (SwiftMessage) new MT701(message);
                case "700":
                    return (SwiftMessage) new MT700(message);
                case "699":
                    return (SwiftMessage) new MT699(message);
                case "698":
                    return (SwiftMessage) new MT698(message);
                case "696":
                    return (SwiftMessage) new MT696(message);
                case "695":
                    return (SwiftMessage) new MT695(message);
                case "692":
                    return (SwiftMessage) new MT692(message);
                case "691":
                    return (SwiftMessage) new MT691(message);
                case "690":
                    return (SwiftMessage) new MT690(message);
                case "649":
                    return (SwiftMessage) new MT649(message);
                case "646":
                    return (SwiftMessage) new MT646(message);
                case "644":
                    return (SwiftMessage) new MT644(message);
                case "643":
                    return (SwiftMessage) new MT643(message);
                case "620":
                    return (SwiftMessage) new MT620(message);
                case "609":
                    return (SwiftMessage) new MT609(message);
                case "608":
                    return (SwiftMessage) new MT608(message);
                case "607":
                    return (SwiftMessage) new MT607(message);
                case "606":
                    return (SwiftMessage) new MT606(message);
                case "605":
                    return (SwiftMessage) new MT605(message);
                case "604":
                    return (SwiftMessage) new MT604(message);
                case "601":
                    return (SwiftMessage) new MT601(message);
                case "600":
                    return (SwiftMessage) new MT600(message);
                case "599":
                    return (SwiftMessage) new MT599(message);
                case "598":
                    return (SwiftMessage) new MT598(message);
                case "596":
                    return (SwiftMessage) new MT596(message);
                case "595":
                    return (SwiftMessage) new MT595(message);
                case "592":
                    return (SwiftMessage) new MT592(message);
                case "591":
                    return (SwiftMessage) new MT591(message);
                case "590":
                    return (SwiftMessage) new MT590(message);
                case "589":
                    return (SwiftMessage) new MT589(message);
                case "588":
                    return (SwiftMessage) new MT588(message);
                case "587":
                    return (SwiftMessage) new MT587(message);
                case "586":
                    return (SwiftMessage) new MT586(message);
                case "584":
                    return (SwiftMessage) new MT584(message);
                case "582":
                    return (SwiftMessage) new MT582(message);
                case "581":
                    return (SwiftMessage) new MT581(message);
                case "579":
                    return (SwiftMessage) new MT579(message);
                case "578":
                    return (SwiftMessage) new MT578(message);
                case "577":
                    return (SwiftMessage) new MT577(message);
                case "576":
                    return (SwiftMessage) new MT576(message);
                case "575":
                    return (SwiftMessage) new MT575(message);
                case "574":
                    SwiftBlock3 block3_1 = message.Block3;
                    if (block3_1 != null)
                    {
                    SwiftTag tagByName = block3_1.GetTagByName("119");
                    if (tagByName != null)
                    {
                        if (tagByName.Value == "IRSLST")
                        return (SwiftMessage) new MT574_IRSLST(message);
                        if (tagByName.Value == "W8BENO")
                        return (SwiftMessage) new MT574_W8BENO(message);
                    }
                    }
                    return new SwiftMessage(message);
                case "569":
                    return (SwiftMessage) new MT569(message);
                case "568":
                    return (SwiftMessage) new MT568(message);
                case "567":
                    return (SwiftMessage) new MT567(message);
                case "566":
                    return (SwiftMessage) new MT566(message);
                case "565":
                    return (SwiftMessage) new MT565(message);
                case "564":
                    return (SwiftMessage) new MT564(message);
                case "559":
                    return (SwiftMessage) new MT559(message);
                case "558":
                    return (SwiftMessage) new MT558(message);
                case "549":
                    return (SwiftMessage) new MT549(message);
                case "548":
                    return (SwiftMessage) new MT548(message);
                case "547":
                    return (SwiftMessage) new MT547(message);
                case "546":
                    return (SwiftMessage) new MT546(message);
                case "545":
                    return (SwiftMessage) new MT545(message);
                case "544":
                    return (SwiftMessage) new MT544(message);
                case "543":
                    return (SwiftMessage) new MT543(message);
                case "542":
                    return (SwiftMessage) new MT542(message);
                case "541":
                    return (SwiftMessage) new MT541(message);
                case "540":
                    return (SwiftMessage) new MT540(message);
                case "538":
                    return (SwiftMessage) new MT538(message);
                case "537":
                    return (SwiftMessage) new MT537(message);
                case "536":
                    return (SwiftMessage) new MT536(message);
                case "535":
                    return (SwiftMessage) new MT535(message);
                case "530":
                    return (SwiftMessage) new MT530(message);
                case "529":
                    return (SwiftMessage) new MT529(message);
                case "528":
                    return (SwiftMessage) new MT528(message);
                case "527":
                    return (SwiftMessage) new MT527(message);
                case "526":
                    return (SwiftMessage) new MT526(message);
                case "524":
                    return (SwiftMessage) new MT524(message);
                case "519":
                    return (SwiftMessage) new MT519(message);
                case "518":
                    return (SwiftMessage) new MT518(message);
                case "517":
                    return (SwiftMessage) new MT517(message);
                case "516":
                    return (SwiftMessage) new MT516(message);
                case "515":
                    return (SwiftMessage) new MT515(message);
                case "514":
                    return (SwiftMessage) new MT514(message);
                case "513":
                    return (SwiftMessage) new MT513(message);
                case "510":
                    return (SwiftMessage) new MT510(message);
                case "509":
                    return (SwiftMessage) new MT509(message);
                case "508":
                    return (SwiftMessage) new MT508(message);
                case "507":
                    return (SwiftMessage) new MT507(message);
                case "506":
                    return (SwiftMessage) new MT506(message);
                case "505":
                    return (SwiftMessage) new MT505(message);
                case "504":
                    return (SwiftMessage) new MT504(message);
                case "503":
                    return (SwiftMessage) new MT503(message);
                case "502":
                    return (SwiftMessage) new MT502(message);
                case "501":
                    return (SwiftMessage) new MT501(message);
                case "500":
                    return (SwiftMessage) new MT500(message);
                case "499":
                    return (SwiftMessage) new MT499(message);
                case "498":
                    return (SwiftMessage) new MT498(message);
                case "496":
                    return (SwiftMessage) new MT496(message);
                case "495":
                    return (SwiftMessage) new MT495(message);
                case "492":
                    return (SwiftMessage) new MT492(message);
                case "491":
                    return (SwiftMessage) new MT491(message);
                case "490":
                    return (SwiftMessage) new MT490(message);
                case "456":
                    return (SwiftMessage) new MT456(message);
                case "455":
                    return (SwiftMessage) new MT455(message);
                case "450":
                    return (SwiftMessage) new MT450(message);
                case "430":
                    return (SwiftMessage) new MT430(message);
                case "422":
                    return (SwiftMessage) new MT422(message);
                case "420":
                    return (SwiftMessage) new MT420(message);
                case "416":
                    return (SwiftMessage) new MT416(message);
                case "412":
                    return (SwiftMessage) new MT412(message);
                case "410":
                    return (SwiftMessage) new MT410(message);
                case "405":
                    return (SwiftMessage) new MT405(message);
                case "400":
                    return (SwiftMessage) new MT400(message);
                case "399":
                    return (SwiftMessage) new MT399(message);
                case "398":
                    return (SwiftMessage) new MT398(message);
                case "396":
                    return (SwiftMessage) new MT396(message);
                case "395":
                    return (SwiftMessage) new MT395(message);
                case "392":
                    return (SwiftMessage) new MT392(message);
                case "391":
                    return (SwiftMessage) new MT391(message);
                case "390":
                    return (SwiftMessage) new MT390(message);
                case "381":
                    return (SwiftMessage) new MT381(message);
                case "380":
                    return (SwiftMessage) new MT380(message);
                case "365":
                    return (SwiftMessage) new MT365(message);
                case "364":
                    return (SwiftMessage) new MT364(message);
                case "362":
                    return (SwiftMessage) new MT362(message);
                case "361":
                    return (SwiftMessage) new MT361(message);
                case "360":
                    return (SwiftMessage) new MT360(message);
                case "350":
                    return (SwiftMessage) new MT350(message);
                case "341":
                    return (SwiftMessage) new MT341(message);
                case "340":
                    return (SwiftMessage) new MT340(message);
                case "330":
                    return (SwiftMessage) new MT330(message);
                case "321":
                    return (SwiftMessage) new MT321(message);
                case "320":
                    return (SwiftMessage) new MT320(message);
                case "307":
                    return (SwiftMessage) new MT307(message);
                case "306":
                    return (SwiftMessage) new MT306(message);
                case "305":
                    return (SwiftMessage) new MT305(message);
                case "304":
                    return (SwiftMessage) new MT304(message);
                case "303":
                    return (SwiftMessage) new MT303(message);
                case "300":
                    return (SwiftMessage) new MT300(message);
                case "299":
                    return (SwiftMessage) new MT299(message);
                case "298":
                    return (SwiftMessage) new MT298(message);
                case "296":
                    return (SwiftMessage) new MT296(message);
                case "295":
                    return (SwiftMessage) new MT295(message);
                case "293":
                    return (SwiftMessage) new MT293(message);
                case "292":
                    return (SwiftMessage) new MT292(message);
                case "291":
                    return (SwiftMessage) new MT291(message);
                case "290":
                    return (SwiftMessage) new MT290(message);
                case "256":
                    return (SwiftMessage) new MT256(message);
                case "210":
                    return (SwiftMessage) new MT210(message);
                case "207":
                    return (SwiftMessage) new MT207(message);
                case "205":
                    SwiftBlock3 block3_2 = message.Block3;
                    if (block3_2 != null)
                    {
                    SwiftTag tagByName = block3_2.GetTagByName("119");
                    if (tagByName != null && tagByName.Value == "COV")
                        return (SwiftMessage) new MT205COV(message);
                    }
                    return (SwiftMessage) new MT205(message);
                case "204":
                    return (SwiftMessage) new MT204(message);
                case "203":
                    return (SwiftMessage) new MT203(message);
                case "202":
                    SwiftBlock3 block3_3 = message.Block3;
                    if (block3_3 != null)
                    {
                    SwiftTag tagByName = block3_3.GetTagByName("119");
                    if (tagByName != null && tagByName.Value == "COV")
                        return (SwiftMessage) new MT202COV(message);
                    }
                    return (SwiftMessage) new MT202(message);
                case "201":
                    return (SwiftMessage) new MT201(message);
                case "200":
                    return (SwiftMessage) new MT200(message);
                case "199":
                    return (SwiftMessage) new MT199(message);
                case "198":
                    return (SwiftMessage) new MT198(message);
                case "196":
                    return (SwiftMessage) new MT196(message);
                case "195":
                    return (SwiftMessage) new MT195(message);
                case "192":
                    return (SwiftMessage) new MT192(message);
                case "191":
                    return (SwiftMessage) new MT191(message);
                case "190":
                    return (SwiftMessage) new MT190(message);
                case "112":
                    return (SwiftMessage) new MT112(message);
                case "111":
                    return (SwiftMessage) new MT111(message);
                case "110":
                    return (SwiftMessage) new MT110(message);
                case "107":
                    return (SwiftMessage) new MT107(message);
                case "105":
                    return (SwiftMessage) new MT105(message);
                case "104":
                    return (SwiftMessage) new MT104(message);
                case "103":
                    SwiftBlock3 block3_4 = message.Block3;
                    if (block3_4 != null)
                    {
                    SwiftTag tagByName = block3_4.GetTagByName("119");
                    if (tagByName != null && tagByName.Value == "STP")
                        return (SwiftMessage) new MT103PLUS(message);
                    }
                    return (SwiftMessage) new MT103(message);
                case "102":
                    SwiftBlock3 block3_5 = message.Block3;
                    if (block3_5 != null)
                    {
                    SwiftTag tagByName = block3_5.GetTagByName("119");
                    if (tagByName != null && tagByName.Value == "STP")
                        return (SwiftMessage) new MT102PLUS(message);
                    }
                    return (SwiftMessage) new MT102(message);
                case "101":
                    return (SwiftMessage) new MT101(message);
                case "S43":
                    return (SwiftMessage) new MTS43(message);
                case "S42":
                    return (SwiftMessage) new MTS42(message);
                case "S35":
                    return (SwiftMessage) new MTS35(message);
                case "S33":
                    return (SwiftMessage) new MTS33(message);
                case "S26":
                    return (SwiftMessage) new MTS26(message);
                case "S25":
                    return (SwiftMessage) new MTS25(message);
                case "S23":
                    return (SwiftMessage) new MTS23(message);
                case "S22":
                    return (SwiftMessage) new MTS22(message);
                case "S21":
                    return (SwiftMessage) new MTS21_FIN_ACKNAK(message);
                case "S15":
                    return (SwiftMessage) new MTS15(message);
                case "S14":
                    return (SwiftMessage) new MTS14(message);
                case "S13":
                    return (SwiftMessage) new MTS13(message);
                case "S12":
                    return (SwiftMessage) new MTS12(message);
                case "S06":
                    return (SwiftMessage) new MTS06(message);
                case "S05":
                    return (SwiftMessage) new MTS05(message);
                case "S03":
                    return (SwiftMessage) new MTS03(message);
                case "S02":
                    return (SwiftMessage) new MTS02(message);
                case "097":
                    return (SwiftMessage) new MT097(message);
                case "096":
                    return (SwiftMessage) new MT096(message);
                case "094":
                    return (SwiftMessage) new MT094(message);
                case "092":
                    return (SwiftMessage) new MT092(message);
                case "090":
                    return (SwiftMessage) new MT090(message);
                case "087":
                    return (SwiftMessage) new MT087(message);
                case "085":
                    return (SwiftMessage) new MT085(message);
                case "083":
                    return (SwiftMessage) new MT083(message);
                case "082":
                    return (SwiftMessage) new MT082(message);
                case "081":
                    return (SwiftMessage) new MT081(message);
                case "077":
                    return (SwiftMessage) new MT077(message);
                case "076":
                    return (SwiftMessage) new MT076(message);
                case "075":
                    return (SwiftMessage) new MT075(message);
                case "074":
                    return (SwiftMessage) new MT074(message);
                case "073":
                    return (SwiftMessage) new MT073(message);
                case "072":
                    return (SwiftMessage) new MT072(message);
                case "069":
                    return (SwiftMessage) new MT069(message);
                case "068":
                    return (SwiftMessage) new MT068(message);
                case "067":
                    return (SwiftMessage) new MT067(message);
                case "066":
                    return (SwiftMessage) new MT066(message);
                case "065":
                    return (SwiftMessage) new MT065(message);
                case "064":
                    return (SwiftMessage) new MT064(message);
                case "063":
                    return (SwiftMessage) new MT063(message);
                case "062":
                    return (SwiftMessage) new MT062(message);
                case "061":
                    return (SwiftMessage) new MT061(message);
                case "057":
                    return (SwiftMessage) new MT057(message);
                case "056":
                    return (SwiftMessage) new MT056(message);
                case "055":
                    return (SwiftMessage) new MT055(message);
                case "052":
                    return (SwiftMessage) new MT052(message);
                case "051":
                    return (SwiftMessage) new MT051(message);
                case "049":
                    return (SwiftMessage) new MT049(message);
                case "048":
                    return (SwiftMessage) new MT048(message);
                case "047":
                    return (SwiftMessage) new MT047(message);
                case "046":
                    return (SwiftMessage) new MT046(message);
                case "045":
                    return (SwiftMessage) new MT045(message);
                case "044":
                    return (SwiftMessage) new MT044(message);
                case "043":
                    return (SwiftMessage) new MT043(message);
                case "042":
                    return (SwiftMessage) new MT042(message);
                case "041":
                    return (SwiftMessage) new MT041(message);
                case "037":
                    return (SwiftMessage) new MT037(message);
                case "036":
                    return (SwiftMessage) new MT036(message);
                case "035":
                    return (SwiftMessage) new MT035(message);
                case "032":
                    return (SwiftMessage) new MT032(message);
                case "031":
                    return (SwiftMessage) new MT031(message);
                case "029":
                    return (SwiftMessage) new MT029(message);
                case "028":
                    return (SwiftMessage) new MT028(message);
                case "023":
                    return (SwiftMessage) new MT023(message);
                case "022":
                    return (SwiftMessage) new MT022(message);
                case "021":
                    return (SwiftMessage) new MT021(message);
                case "020":
                    return (SwiftMessage) new MT020(message);
                case "019":
                    return (SwiftMessage) new MT019(message);
                case "015":
                    return (SwiftMessage) new MT015(message);
                case "012":
                    return (SwiftMessage) new MT012(message);
                case "011":
                    return (SwiftMessage) new MT011(message);
                case "010":
                    return (SwiftMessage) new MT010(message);
                case "009":
                    return (SwiftMessage) new MT009(message);
                case "008":
                    return (SwiftMessage) new MT008(message);
                default:
                    return new SwiftMessage(message);
            }
        }
    }
}
